package com.jtlrm.ckd.mvp.view.adapter;


import android.widget.ImageView;

import com.base.sdk.util.ImageUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jtlrm.ckd.R;
import com.jtlrm.ckd.entity.GroupEntity;
import com.jtlrm.ckd.mvp.model.dao.UserHelper;

public class GroupAdapter extends BaseQuickAdapter<GroupEntity, BaseViewHolder> {

    UserHelper userHelper;
    public GroupAdapter() {
        super(R.layout.group_item);
        userHelper = UserHelper.getInstance(mContext);
    }

    @Override
    protected void convert(BaseViewHolder helper, GroupEntity item) {
        helper.setText(R.id.name, item.getName());
        if (userHelper.isHospitalGroup(item.getEasemobGroupId())){
            ImageUtil.loadImage((ImageView) helper.getView(R.id.avatar), R.drawable.logo);
        } else {
            ImageUtil.loadImage((ImageView) helper.getView(R.id.avatar), R.drawable.ease_group_icon);
        }
    }
}

